#!/usr/env/bin python
# -*- coding: utf-8 -*-

# @Time    : 2019/12/12 12:01|12:01
# @Author  : yangdingyi
# @File    : 存在重复元素
# @Software: PyCharm

from typing import List


class Solution:
    def containsDuplicate(self, nums: List[int]) -> bool:
        n_set = set()
        for i, a in enumerate(nums):
            if a in n_set:
                return True
            n_set.add(a)
        return False
